package leetcode.weekly.week291;

import leetcode.IDebug;

public class Solution1 implements IDebug {

	public String removeDigit(String number, char digit) {
		char[] cs = number.toCharArray();
		String max = null;
		for (int i = 0; i < cs.length; i++) {
			char c = cs[i];
			if (c == digit) {
				StringBuffer sb = new StringBuffer();
				for (int j = 0; j < cs.length; j++) {
					if (j != i) {
						sb.append(cs[j]);
					}
				}
				if (max == null) {
					max = sb.toString();
				} else if (sb.toString().compareTo(max) > 0) {
					max = sb.toString();
				}
			}
		}
		return max;
	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug3() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug2() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug1() {
		// TODO Auto-generated method stub

	}

	public static void main(String[] args) {
		Solution1 so = new Solution1();
		so.debug1();
		so.debug2();
		so.debug3();
		so.debug4();

	}

}
